﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace ServerNodeLib
{
	/// <summary>
	/// Defines information on a resource.
	/// This class is documented from the perspective of the client.
	/// </summary>
	[DataContract()]
	public class ResourceInfo
	{
		/// <summary>
		/// For receiving:
		/// The path that the client will check locally.
		/// For sending:
		/// The local path that the client will send to the server.
		/// </summary>
		[DataMember()]
		[DefaultValue("")]
		public String DestName;
		/// <summary>
		/// For receiving:
		/// The size of the file.  Useful for calculating the number of chunks.
		/// For sending:
		/// Not used.
		/// </summary>
		[DataMember()]
		[DefaultValue(0)]
		public long DestSize;
		/// <summary>
		/// For receiving:
		/// The hash of the valid file.  Used for checking that files are up to date.
		/// For sending:
		/// Not used.
		/// </summary>
		[DataMember()]
		[DefaultValue("")]
		public String Md5Hash;
		/// <summary>
		/// For receiving and sending:
		/// The server-imposed limit on chunk size.  DestSize / TransferChunkSize = NumChunks
		/// </summary>
		[DataMember()]
		[DefaultValue(0)]
		public int TransferChunkSize;
	}
}
